<%-- 
    Document   : viewUser
    Created on : Apr 30, 2011, 8:49:02 PM
    Author     : christophe
--%>

<%@page import="java.util.List"%>
<%@page import="com.garagesale.data.User"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@include file="/WEB-INF/jspf/tagImports.jspf" %>

<!-- The following page directive is needed for c:out to work properly.. otherwise,  -->
<!-- you get the following error: "According to TLD or attribute directive in tag file, attribute var does not accept any..." -->


<html:html lang="true">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Register User</title>
    </head>
    <tags:menu />
    <div id ="content">
        <tags:body>
          <h2>Regisiter User </h2>
            <html:errors/>

            <c:if test="${requestScope.inError}">
                <div id="errorMessage" style="color: red;">Please fill in any missing fields</div>
            </c:if>


            <c:url var="saveUserUrl" value="/user/saveUser.do" />

            <c:if test="${UserForm.action eq 'create' or  UserForm.userID eq null or UserForm.userID eq 0}">
                <c:url var="saveUserUrl" value="/saveUser.do" />
            </c:if>



            <form action="${saveUserUrl}" method="post">
                <c:if test="${UserForm.userID ne 0 or not empty UserForm.userID}">
                    <input type="hidden" name="userID" value="${UserForm.userID}" />
                </c:if>

                <br />
                <tags:textInput formFieldName="firstName" labelName="First Name:" textValue="${UserForm.firstName}" />
                <tags:textInput formFieldName="lastName" labelName="Last Name:" textValue="${UserForm.lastName}" />
                <tags:textInput formFieldName="emailAddress" labelName="Email Address:" textValue="${UserForm.emailAddress}" />
                <tags:textInput formFieldName="username" labelName="User Name:" textValue="${UserForm.username}" />
                <tags:textInput formFieldName="password" labelName="Password:" textValue="${UserForm.password}" />



                <input type="submit" value="Save User" />

            </form>



        </tags:body>
    </div>

    <div id = "footer">
        <span>
            &nbsp;All rights reserved Garage Sale 2011 | Legal | Privacy Policy
        </span>
        <br><br>
        <img alt="" src="../../images/b1.gif">
        <img alt="" src="../../images/b2.gif" style="margin:0px 5px 0px 5px">
        <img alt="" src="../../images/b3.gif">
    </div>
</html:html>
